import { list } from '@/api/hmmm/subjects'
import { list as cataloglist } from '@/api/hmmm/directorys'
const subjectlist = {
  namespaced: true,
  state () {
    return {
      subjectData: [],
      catalogData: []
    }
  },
  mutations: {
    // 存学科列表
    setsubjectData (state, value) {
      state.subjectData = value
    },
    setcatalogData (state, value) {
      state.catalogData = value
    }
  },
  actions: {
    async  getsubjectlist (store) {
      const res = await list()
      store.commit('setsubjectData', res.data.items)
    },
    async getcataloglist (store) {
      const res = await cataloglist()
      store.commit('setcatalogData', res.data.items)
    }
  }
}
export default subjectlist
